package com.saas.tenant.tenantConfig;

/**
 * @auther Jiang Tian
 * @date 2025/3/3
 * @apiNote
 **/
public class TenantContextHolder {

    private static final ThreadLocal<Long> tenantIdThreadLocal = new ThreadLocal<>();

    public static void setTenantId(Long tenantId) {
        tenantIdThreadLocal.set(tenantId);
    }

    public static Long getTenantId() {
        return tenantIdThreadLocal.get();
    }

    public static void clear() {
        tenantIdThreadLocal.remove();
    }
}
